


class Dog {
    public String name;
    public int age;
    public String color;

    public void bark() {
        System.out.println("汪汪汪");
    }
    public void eat() {
        System.out.println("吃狗粮");
    }
}

public class Test4 {
    public static void main(String[] args) {
        Dog dog=new Dog();//通过new实例化对象
        dog.name="小白";
        dog.age=3;
        dog.color="白色";
        dog.bark();
        dog.eat();
    }
}
